<?php echo $header; ?>  

<div id="main" class="p13t">
        <!-- Left column -->
        <?php echo $column_left; ?>
        
        <div id="col2" class="w709">             
            <div class="box_tt">
                <div class="tt_logo float_left"><?php echo $heading_title; ?></div>
                <div class="float_left" style="height: 18px; padding: 5px 30px 5px 12px;">
                    <span class="sort_products"><?php echo $text_sort; ?></span>
                    <select class="sort_products" name="sort" onchange="location = this.value">
                          <?php foreach ($sorts as $sort_item) { ?>
                              <?php if (($sort . '-' . $order) == $sort_item['value']) { ?>
                                  <option value="<?php echo $sort_item['href']; ?>" selected="selected"><?php echo $sort_item['text']; ?></option>
                              <?php } else { ?>
                                  <option value="<?php echo $sort_item['href']; ?>"><?php echo $sort_item['text']; ?></option>
                              <?php } ?>
                          <?php }?>
                    </select>
                </div>
                <div class="float_right p16r"><a href="<?php echo 'javascript:history.back()'; //$back; ?>"><img src="catalog/view/theme/<?php echo $template; ?>/images/bt_tibage.png" alt="" /></a></div>
                <div class="cb"></div>
            </div> 
            
            <div class="box_content_underpage">
                <div class="box_content_underpage1 min_heght">  
                    <div class="p10t p20l p20r"> 
                        <div class="box_pro_choice_all">
                            <div class="box_pro_choice_pic">
                                <div id="slider">
                                    <?php if(count($images) == 1){ ?>
                                        <div class="sliderImage" style="display: block;"><img src="<?php echo $images[0]; ?>" /> <span></span></div> 
                                    <?php }else{ ?> 
                                        <ul id="sliderContent">
                                            <?php foreach($images as $image){ ?>
                                                <li class="sliderImage"><img src="<?php echo $image; ?>" /> <span></span></li>                                                
                                            <?php } ?>
                                            <li class="sliderImage"></li>
                                        </ul>
                                    <?php } ?> 
                                </div> 
                            </div>
                            <div class="box_pro_choice_text">
                                <div class="line_btom p15 font11_blu"><?php echo $title; ?></div>
                                <div class="p15l p10t p15r p15b"><?php echo $description; ?></div>
                            </div>
                            <div class="cb"></div>
                        </div>
                        
                        
                        
                        <div class="images_list">
                            <?php $i = 0; $class = ''; ?>
                            <?php foreach($products as $product){ ?> 
                                <?php 
                                //if($i % 4 == 0){
                                if($i % 3 == 0){
                                    //$class = 'line_pro_right p28r';  
                                    $class = 'line_pro_right pr_pad_right';                                    
                                }
                                //elseif(($i + 1) % 4 == 0){
                                elseif(($i + 1) % 3 == 0){
                                    //$class = 'p26l';
                                    $class = 'pr_pad_left';                                    
                                }
                                else{
                                    //$class = 'line_pro_right p28r p26l';
                                    $class = 'line_pro_right pr_pad_right pr_pad_left';                                    
                                }
                                ?>
                                 
                                <div class="product_data_area box_img_pro float_left p20t <?php echo $class; ?>">
                                    <div class="product_img_container">
                                        <a class="product_img_area" href="<?php echo $product['href']; ?>" title="<?php echo $product['name']; ?>"><img src="<?php echo $product['thumb']; ?>"  alt="<?php echo $product['name']; ?>" /></a>
                                        <?php if($product['options']) { ?>
                                            <a class="product_sizes_popup" href="<?php echo $product['href']; ?>">
                                                <?php $op = 0; ?>
                                                <?php foreach($product['options'] as $options){ ?>
                                                    <?php                                            
                                                    $option_data = '';                                            
                                                    foreach($options['option_value'] as $option_item){
                                                        $option_data .=  $option_item['name'] . ', ';
                                                    }
                                                    $option_data = trim($option_data, ', ');
                                                    ?>
                                                        
                                                    <p class="header <?php echo ($op > 0 ? ' p5t' : ''); ?>"><?php echo (strcasecmp($options['name'], 'Størrelse') == 0) ? 'Størrelser' : $options['name'] ?></p>
                                                    <p class="data"><?php echo $option_data ?></p>
                                                    <?php $op++; ?>
                                                <?php } ?>
                                            </a>
                                        <?php } ?>
                                    </div>                                    
                                    <div class="text_pro cat_product_name">
                                        <?php if(1==0){ ?>  
                                            <?php echo $product['shortname']; ?><br />
                                            <span class="style1">ID: <?php echo $product['sku']; ?></span><br />
                                        <?php } ?>
                                        
                                        <?php echo $product['shortname']; ?>
                                        <?php //if($product['unbreak']){ echo '<br />';} ?>
                                        <br />
                                        <?php if($product['discount']){ ?>
                                            <span class="cat_style9"><span class="cat_style9_discount">&nbsp;<?php echo $product['ref_price'] ? 'Priser fra ' . $product['ref_price'] : $product['discount']; ?></span></span>&nbsp;&nbsp;
                                            <span class="cat_style3"><span class="cat_style2_discount">&nbsp;<?php echo $product['price']; ?></span></span>
                                        <?php }else{ ?>
                                            <span class="cat_style2"><?php echo $product['ref_price'] ? 'Priser fra ' . $product['ref_price'] : $product['price']; ?></span><br>
                                        <?php } ?>
                                        <div style="margin-top:3px;">
                                            <span class="tooltips_shipping_list">Se pris inkl. fragt/gebyr</span>
                                            <div class="tooltips_shipping_style_list"><?php echo $shipping_note; ?></div>
                                        </div>
                                    </div>                                                                                                           
                                </div>
                                <?php $i++; ?> 
                                
                                <?php if($i % 3 == 0){ //if($i % 4 == 0){ ?>                                        
                                    <div class="cb"></div> 
                                <?php } ?> 
                            <?php } ?> 
                            
                            <?php if(!($i % 3 == 0)){  //if(!($i % 4 == 0)){  ?>                                        
                                <div class="cb"></div> 
                            <?php } ?>   
                        </div>
                        
                        <!-- Paging -->
                        <?php if($pagination){ ?>
                            <div class="tt_top_pro1 m15t">
                                   <?php echo $pagination; ?>
                            </div>
                        <?php } ?>                          
                    </div>                      
                </div>
            </div>
            <div class="box_bottom">
                <div class="all_page_bt"></div>
            </div>                   
        </div>
        
        <p class="cb"></p>
    </div>
</div>
<!-- End content -->

<!-- footer -->
<script type="text/javascript" src="catalog/view/theme/<?php echo $template; ?>/js/s3Slider.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('#slider').s3Slider({
            timeOut: 4000
        });
    });
</script>
<script type="text/javascript">    
	//Begin show text when mouseover
    var timeHandle = null;
    
	jQuery(document).ready(function() {		
        jQuery(".tooltips_shipping_list").hover(
			function(){ jQuery(this).siblings('div.tooltips_shipping_style_list:first').css({ display: "block" }); },
			function() { jQuery(this).siblings('div.tooltips_shipping_style_list:first').css({ display: "none" }); }			
		);        
        
        jQuery(".product_img_container").mouseover(
            function(event){
				var element =  jQuery(this).children('.product_sizes_popup');
				if(element.length > 0){
					element.css({display: "block"});
				}
            }).mouseout(function(event){
				var element =  jQuery(this).children('.product_sizes_popup');
                if(element.length > 0){
					element.css({display: "none"});
				}
            }
        );
	});
</script>
<?php echo $footer; ?> 

